package com.distributedDataBase.controller;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/review")
public class ControllerReview {

    @GetMapping("/test01")
    public String test01(HttpServletRequest request) {
        System.out.println("哈哈哈哈哈哈哈哈哈哈哈哈哈哈test01");
        System.out.println("username:" + request.getAttribute("username"));
        return "/demo/hello.html";
    }

    @GetMapping("/test02")
    public String test02(HttpServletRequest request) {
        request.setAttribute("username", "万年老2");
        System.out.println("哈哈哈哈哈哈哈哈哈哈哈哈哈哈test02");
        return "forward:test01";
    }

    @GetMapping("/test03")
    public String test03(HttpServletRequest request) {
        request.setAttribute("username", "印度阿3");
        System.out.println("哈哈哈哈哈哈哈哈哈哈哈哈哈哈test03");
        return "redirect:test01";
    }

}
